import random as r


money = 1000
while True:
    if money < 900:
        print("你的余额不足，不能参加游戏")
        break
    guess = input('猜大小(请输入"大"或者"小"或者"exit")：')
    sum = 0
    for i in range(3):
        num = r.randint(1, 6)
        sum += num
    if guess == "exit":
        print("退出！")
        break
    elif 3 <= sum <= 10 and guess == "小":
        print("结果：小 你猜对了")
        money += 100
        print(money)
    elif 3 <= sum <= 10 and guess == "大":
        print("结果：小 你猜错了")
        money -= 100
        print(money)
    elif 11 <= sum <= 18 and guess == "大":
        print("结果：大 你猜对了")
        money += 100
        print(money)
    elif 11 <= sum <= 18 and guess == "小":
        print("结果：大 你猜错了")
        money -= 100
        print(money)
    else:
        print("输入有误，请重新输入！")
    print("------------------------------------------")

